<%@ page contentType="text/html; charset=UTF-8" %>
<%@page import="com.jiuqi.webtree.WebTreeIntfInstMgr"%>
<%@page import="com.jiuqi.webtree.WebTree"%>
<%@page import="com.jiuqi.webtree.WebTreeClient"%>
<%@page import="com.jiuqi.webtree.WebTreeIntf"%>
<%@page import="com.infomanage.util.PersonTree"%>
<%  response.addDateHeader("Expires", 0);response.setHeader("Pragma","no-cache"); response.setHeader("Cache-Control","no-cache");%>
<html>
<head>
<link rel="stylesheet" type="text/css" href="../../css/webTree.css">
<script type="text/javascript" src="../../js/webTree.js"></script>
<script type="text/javascript">
	    /**
		 * 双击选择事件
		 */
		function onDblClick(nodeObj) {
		   if(nodeObj.container == true){
		   		alert("请选择员工");
		   		return;
		   }
		   var nodeId = nodeObj.nodeId;
		   var nodeTitle = nodeObj.nodeName;
		   parent.selectNode(nodeId, nodeTitle);
		}
		
		/**
		 * 单击选择事件
		 */
		function onClick(nodeObj) {
		}
		
</script>
</head>
<body style="margin:0px;padding:0px;" bottommargin="0" topmargin="0" leftmargin="0" rightmargin="0">
     <div id="mytree" class="treeDiv">
     </div>
</body>
  <%  
  	WebTreeIntf deptTree = new PersonTree(request, false);
	String treeId = WebTreeIntfInstMgr.registerWebTreeIntf(deptTree, request);
	WebTree webTree = new WebTree("mytree", "../../img/tree", treeId);
	webTree.attachEvent(WebTree.event_onDblClick,"onDblClick");
	webTree.attachEvent(WebTree.event_onClick,"onClick");
	webTree.setAutoToFirstNode(false);
    WebTreeClient webTreeClient = new WebTreeClient(out, request, response);
	webTreeClient.createTree(webTree);
   %> 
</html>
